<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.0.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/blog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/blog/css/main.css">


<link rel="stylesheet" href="/blog/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"xuarmy.gitee.io","root":"/blog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="1. 单例模式1.1. 单例简介单例模式可以保证在整个应用程序运行过程中，一个类只有一个实例，共享一份资源。易于供外界访问，方便控制，节约系统资源，一般用于工具类。例如：登陆控制器，网络数据请求等。 1.2. 单例特点 单例的优点  1.保证系统中一个类只有一个实例，该实例易于外界访问，方便对实例个数的控制并节约系统资源。2.保证局部变量永远只初始化一次，在程序运行过程中，永远只有一分内存。">
<meta property="og:type" content="article">
<meta property="og:title" content="iOS - 单例模式">
<meta property="og:url" content="http://xuarmy.gitee.io/blog/2020/08/14/%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F/index.html">
<meta property="og:site_name" content="代号·破局">
<meta property="og:description" content="1. 单例模式1.1. 单例简介单例模式可以保证在整个应用程序运行过程中，一个类只有一个实例，共享一份资源。易于供外界访问，方便控制，节约系统资源，一般用于工具类。例如：登陆控制器，网络数据请求等。 1.2. 单例特点 单例的优点  1.保证系统中一个类只有一个实例，该实例易于外界访问，方便对实例个数的控制并节约系统资源。2.保证局部变量永远只初始化一次，在程序运行过程中，永远只有一分内存。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-08-14T14:26:23.000Z">
<meta property="article:modified_time" content="2020-08-14T14:32:38.204Z">
<meta property="article:author" content="xuarmy">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://xuarmy.gitee.io/blog/2020/08/14/%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>iOS - 单例模式 | 代号·破局</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/blog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">代号·破局</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">学无先后·达者为先</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://xuarmy.gitee.io/blog/2020/08/14/%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/photo.jpg">
      <meta itemprop="name" content="xuarmy">
      <meta itemprop="description" content="木を植える一番いい時間は十年前、次は今です。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="代号·破局">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          iOS - 单例模式
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-08-14 22:26:23 / 修改时间：22:32:38" itemprop="dateCreated datePublished" datetime="2020-08-14T22:26:23+08:00">2020-08-14</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="1-单例模式"><a href="#1-单例模式" class="headerlink" title="1. 单例模式"></a>1. 单例模式</h1><h2 id="1-1-单例简介"><a href="#1-1-单例简介" class="headerlink" title="1.1. 单例简介"></a>1.1. 单例简介</h2><p>单例模式可以保证在整个应用程序运行过程中，一个类只有一个实例，共享一份资源。易于供外界访问，方便控制，节约系统资源，一般用于工具类。例如：登陆控制器，网络数据请求等。</p>
<h2 id="1-2-单例特点"><a href="#1-2-单例特点" class="headerlink" title="1.2. 单例特点"></a>1.2. 单例特点</h2><ul>
<li><p><strong>单例的优点</strong></p>
<blockquote>
<p>1.保证系统中一个类只有一个实例，该实例易于外界访问，方便对实例个数的控制并节约系统资源。<br>2.保证局部变量永远只初始化一次，在程序运行过程中，永远只有一分内存。</p>
</blockquote>
</li>
<li><p><strong>单例的缺点</strong></p>
<blockquote>
<p>1.单例的对象一旦建立，对象指针保存在静态区的，在堆中分配的内存空间，在应用程序终止后才会被释放。<br>2.单例无法继承，因为静态变量也会继承，当子类和父类同时创建的时只会创建一个先创建的实例对象，很难进行类的扩展。<br>3.单例的对象不适用于变化，如果同一类型的对象总是要在不同的用例场景发生变化，单例就会引起数据的错误，不能保存彼此的状态。</p>
</blockquote>
</li>
</ul>
<p><strong>注意：</strong>我们在使用单例类时，一定要考虑好单例类是否适合，和类以后的扩展性，避免滥用单例。</p>
<h1 id="2-iOS常用的单例类"><a href="#2-iOS常用的单例类" class="headerlink" title="2. iOS常用的单例类"></a>2. iOS常用的单例类</h1><table>
<thead>
<tr>
<th>类别</th>
<th>简介</th>
<th>Object-C示例</th>
<th>Swift示例</th>
</tr>
</thead>
<tbody><tr>
<td><code>UIApplication</code></td>
<td>应用程序</td>
<td><code>[UIApplication sharedApplication]</code></td>
<td><code>UIApplication.shared</code></td>
</tr>
<tr>
<td><code>NSNotificationCenter</code></td>
<td>消息中心</td>
<td><code>[NSNotificationCenter defaultCenter]</code></td>
<td><code>NotificationCenter.default</code></td>
</tr>
<tr>
<td><code>NSFileManager</code></td>
<td>文件管理</td>
<td><code>[NSFileManager defaultManager]</code></td>
<td><code>FileManager.default</code></td>
</tr>
<tr>
<td><code>NSUserDefaults</code></td>
<td>偏好设置</td>
<td><code>[NSUserDefaults standardUserDefaults]</code></td>
<td><code>UserDefaults.standard</code></td>
</tr>
<tr>
<td><code>NSURLCache</code></td>
<td>请求缓存</td>
<td><code>[NSURLCache sharedURLCache]</code></td>
<td><code>URLCache.shared</code></td>
</tr>
<tr>
<td><code>NSHTTPCookieStorage</code></td>
<td>Cookie池</td>
<td><code>[NSHTTPCookieStorage sharedHTTPCookieStorage]</code></td>
<td><code>HTTPCookieStorage.shared</code></td>
</tr>
<tr>
<td><code>NSURLSession</code></td>
<td>网络请求</td>
<td><code>[NSURLSession sharedSession]</code></td>
<td><code>URLSession.shared</code></td>
</tr>
<tr>
<td><code>UIMenuController</code></td>
<td>菜单栏</td>
<td><code>[UIMenuController sharedMenuController]</code></td>
<td><code>UIMenuController.shared</code></td>
</tr>
</tbody></table>
<h1 id="3-单例的实现"><a href="#3-单例的实现" class="headerlink" title="3. 单例的实现"></a>3. 单例的实现</h1><p><strong>Obejct-C代码示例</strong></p>
<p>简单写法</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">+ (instancetype)sharedInstance &#123;</span><br><span class="line">  static XATestManager* instance &#x3D; nil;</span><br><span class="line">  static dispatch_once_t onceToken;</span><br><span class="line">  dispatch_once(&amp;onceToken, ^&#123;</span><br><span class="line">    instance &#x3D; [[XATestManager alloc] init];</span><br><span class="line">  &#125;);</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>严谨写法</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line">#import &quot;XATestManager.h&quot;</span><br><span class="line">static XATestManager *instance;</span><br><span class="line"></span><br><span class="line">@implementation XATestManager</span><br><span class="line">&#x2F;&#x2F;给外部提供的类方法</span><br><span class="line">+ (instancetype)shareInstance &#123;</span><br><span class="line">    static dispatch_once_t onceToken;</span><br><span class="line">    dispatch_once(&amp;onceToken, ^&#123;</span><br><span class="line">        instance &#x3D; [[XATestManager alloc] init];</span><br><span class="line">    &#125;);</span><br><span class="line">    </span><br><span class="line">    return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;实例化分配内存</span><br><span class="line">+ (instancetype)allocWithZone:(struct _NSZone *)zone &#123;</span><br><span class="line">    static dispatch_once_t onceToken;</span><br><span class="line">    dispatch_once(&amp;onceToken, ^&#123;</span><br><span class="line">        instance &#x3D; [super allocWithZone:zone];</span><br><span class="line">    &#125;);</span><br><span class="line">    </span><br><span class="line">    return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;实现copy协议</span><br><span class="line">-(id)copyWithZone:(NSZone *)zone &#123;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">- (id)mutableCopyWithZone:(nullable NSZone *)zone &#123;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">- (id)copy &#123;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">-(id)mutableCopy &#123;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line">@end</span><br></pre></td></tr></table></figure>

<p>加互斥锁解决多线程访问安全的写法</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line">#import &quot;XATestManager.h&quot;</span><br><span class="line">static XATestManager *instance;</span><br><span class="line"></span><br><span class="line">@implementation XATestManager</span><br><span class="line">&#x2F;&#x2F;给外部提供的类方法</span><br><span class="line">+ (instancetype)shareInstance &#123;</span><br><span class="line">  @synchronized (self) &#123;</span><br><span class="line">    if (instance &#x3D;&#x3D; nil) &#123;</span><br><span class="line">      instance &#x3D; [[XATestManager alloc] init];</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;实例化分配内存</span><br><span class="line">+ (instancetype)allocWithZone:(struct _NSZone *)zone &#123;</span><br><span class="line">  @synchronized (self) &#123;</span><br><span class="line">    if (instance &#x3D;&#x3D; nil) &#123;</span><br><span class="line">      instance &#x3D; [super allocWithZone:zone];</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F;实现copy协议</span><br><span class="line">-(id)copyWithZone:(NSZone *)zone &#123;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">- (id)mutableCopyWithZone:(nullable NSZone *)zone &#123;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">- (id)copy &#123;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">-(id)mutableCopy &#123;</span><br><span class="line">  return instance;</span><br><span class="line">&#125;</span><br><span class="line">@end</span><br></pre></td></tr></table></figure>



<p><strong>Swift代码示例</strong></p>
<p>可以使用静态类型属性创建简单的单例，即使在多个线程同时访问时，也可以保证仅对它们进行一次惰性初始化：</p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">XATestManager</span> </span>&#123;</span><br><span class="line">    <span class="keyword">static</span> <span class="keyword">let</span> sharedInstance = <span class="type">XATestManager</span>()</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>如果需要执行初始化以外的其他设置，则可以将闭包的调用结果分配给全局常量：</p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">XATestManager</span> </span>&#123;</span><br><span class="line">    <span class="keyword">static</span> <span class="keyword">let</span> sharedInstance: <span class="type">XATestManager</span> = &#123;</span><br><span class="line">        <span class="keyword">let</span> instance = <span class="type">XATestManager</span>()</span><br><span class="line">        <span class="comment">// <span class="doctag">TODO:</span></span></span><br><span class="line">        <span class="keyword">return</span> instance</span><br><span class="line">    &#125;()</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>参考链接: <a target="_blank" rel="noopener" href="https://developer.apple.com/documentation/swift/cocoa_design_patterns/managing_a_shared_resource_using_a_singleton">Apple Inc.</a></p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/blog/2020/08/10/%E4%BB%A3%E7%90%86%E5%9B%9E%E8%B0%83%E9%80%9A%E7%9F%A5%E7%9B%91%E5%90%AC/" rel="prev" title="iOS - 委托、回调、通知、监听">
      <i class="fa fa-chevron-left"></i> iOS - 委托、回调、通知、监听
    </a></div>
      <div class="post-nav-item"></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#1-%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F"><span class="nav-number">1.</span> <span class="nav-text">1. 单例模式</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-1-%E5%8D%95%E4%BE%8B%E7%AE%80%E4%BB%8B"><span class="nav-number">1.1.</span> <span class="nav-text">1.1. 单例简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-2-%E5%8D%95%E4%BE%8B%E7%89%B9%E7%82%B9"><span class="nav-number">1.2.</span> <span class="nav-text">1.2. 单例特点</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#2-iOS%E5%B8%B8%E7%94%A8%E7%9A%84%E5%8D%95%E4%BE%8B%E7%B1%BB"><span class="nav-number">2.</span> <span class="nav-text">2. iOS常用的单例类</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#3-%E5%8D%95%E4%BE%8B%E7%9A%84%E5%AE%9E%E7%8E%B0"><span class="nav-number">3.</span> <span class="nav-text">3. 单例的实现</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="xuarmy"
      src="/blog/images/photo.jpg">
  <p class="site-author-name" itemprop="name">xuarmy</p>
  <div class="site-description" itemprop="description">木を植える一番いい時間は十年前、次は今です。</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/blog/archives/">
        
          <span class="site-state-item-count">4</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xuarmy</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>

<script src="/blog/js/utils.js"></script>

<script src="/blog/js/motion.js"></script>


<script src="/blog/js/schemes/pisces.js"></script>


<script src="/blog/js/next-boot.js"></script>




  















  

  

</body>
</html>
